﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ChineseChess.Utils
{
    /// <summary>
    /// 常量工具
    /// </summary>
    public static class ConstUtil
    {
        /// <summary>
        /// 基本局面
        /// </summary>
        public static readonly char[,] Board =
        {
            { 'r','n','b','a','k','a','b','n','r' },
            { '0','0','0','0','0','0','0','0','0' },
            { '0','c','0','0','0','0','0','c','0' },
            { 'p','0','p','0','p','0','p','0','p' },
            { '0','0','0','0','0','0','0','0','0' },
            { '0','0','0','0','0','0','0','0','0' },
            { 'P','0','P','0','P','0','P','0','P' },
            { '0','C','0','0','0','0','0','C','0' },
            { '0','0','0','0','0','0','0','0','0' },
            { 'R','N','B','A','K','A','B','N','R' },
        };

        /// <summary>
        /// 棋子代号
        /// </summary>
        public const char 俥 = 'R';
        public const char 車 = 'r';
        public const char 傌 = 'N';
        public const char 馬 = 'n';
        public const char 相 = 'B';
        public const char 象 = 'b';
        public const char 仕 = 'A';
        public const char 士 = 'a';
        public const char 帥 = 'K';
        public const char 將 = 'k';
        public const char 炮 = 'C';
        public const char 砲 = 'c';
        public const char 兵 = 'P';
        public const char 卒 = 'p';

        /// <summary>
        /// 棋子名称
        /// </summary>
        public static readonly Dictionary<char, string> PieceName = new()
        {
            { 車, "車" },
            { 俥, "俥" },
            { 馬, "馬" },
            { 傌, "傌" },
            { 相, "相" },
            { 象, "象" },
            { 仕, "仕" },
            { 士, "士" },
            { 將, "將" },
            { 帥, "帥" },
            { 砲, "砲" },
            { 炮, "炮" },
            { 卒, "卒" },
            { 兵, "兵" }
        };
    }
}
